// Copyright 2022 a.o.smith ALL Rights Reserved
package com.liuxinlong.enums;

/**
 * 强制等级枚举
 *
 * @author liuxinlong@hotwater.com.cn
 * @version 1.0.0
 * @since 2022-03-03
 */
public enum MandatoryEnum {
    MANDATORY(1, "强制"), RECOMMEND(2, "推荐"), TRIAL(3, "试行");

    private int value;

    private String name;

    MandatoryEnum(int value, String name) {
        this.value = value;
        this.name = name;
    }

    public int getValue() {
        return value;
    }

    public String getName() {
        return name;
    }

    public static String getNameByValue(int value) {
        MandatoryEnum arrObj[] = MandatoryEnum.values();
        for (MandatoryEnum obj : arrObj) {
            if (value == obj.getValue()) {
                return obj.getName();
            }
        }
        return "";
    }

}
